<?php
	function get_ubb($ubb)
	{
		//转换为链接URL格式，特殊符号用\说明，\\1输出内容
		//$ubb = preg_replace("/\[url\](.*)\[\/url\]/","<a href = \\1 target = \"\_blank\">\\1</a>",$ubb);
		$ubb = preg_replace("/\[img\](.*)\[\/img\]/","<img src = \\1 />",$ubb);//转换为图片

		return $ubb;
	}
	$str = "srfghflks[img]http://www.zouxiuping.com/wp-content/uploads/2014/05/WDCPlogo-196x150.jpg[/img]";
	echo get_ubb($str);
	 
?>